xen/evtchn: modify evtchn_bind_interdomain to support static evtchn
authorRahul Singh <rahul.singh@arm.com>
Wed, 7 Sep 2022 16:27:36 +0000 (17:27 +0100)
committerJulien Grall <jgrall@amazon.com>
Thu, 8 Sep 2022 11:21:59 +0000 (12:21 +0100)
commit7ba046a538cba2bc196d9d6d609594aa3b393f94
tree51f4fc2cf8c572725516ac8c3412621b231887fa
parent5324b179e4658b270c33004038b34c7eaf197ce6
xen/evtchn: modify evtchn_bind_interdomain to support static evtchn

Static event channel support will be added for dom0less domains. Modify
evtchn_bind_interdomain to support static evtchn.

It is necessary to have access to the evtchn_bind_interdomain function
to do that, so make evtchn_bind_interdomain global and also make it
__must_check.

Currently evtchn_bind_interdomain() always allocates the next available
local port. Static event channel support for dom0less domains requires
allocating a specified port. Modify the evtchn_bind_interdomain to
accept the port number as an argument and allocate the specified port
if available. If the port number argument is zero, the next available
port will be allocated.

Currently evtchn_bind_interdomain() finds the local domain from
"current->domain" pointer. evtchn_bind_interdomain() will be called from
the XEN to create static event channel during domain creation.
"current" pointer is not valid at that time, therefore modify the
evtchn_bind_interdomain() to pass domain as an argument.

Signed-off-by: Rahul Singh <rahul.singh@arm.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/common/event_channel.c
xen/include/xen/event.h